<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Creates a new CairoContext</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairocontext.closepath.html">CairoContext::closePath</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairocontext.copypage.html">CairoContext::copyPage</a></div>
 <div class="up"><a href="class.cairocontext.html">CairoContext</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="cairocontext.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">CairoContext::__construct</h1>
  <p class="verinfo">(PECL cairo &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">CairoContext::__construct</span> &mdash; <span class="dc-title">Creates a new CairoContext</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-cairocontext.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>CairoContext::__construct</strong></span>
    ( <span class="methodparam"><span class="type"><a href="class.cairosurface.html" class="type CairoSurface">CairoSurface</a></span> <code class="parameter">$surface</code></span>
   )</div>

  <p class="para rdfs-comment">
   Creates a new CairoContext object to draw
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-cairocontext.construct-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">surface</code></em></dt>

     <dd>

      <p class="para">
       A valid <a href="class.cairosurface.html" class="classname">CairoSurface</a> like <a href="class.cairoimagesurface.html" class="classname">CairoImageSurface</a> or
       <a href="class.cairopdfsurface.html" class="classname">CairoPdfSurface</a>
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-cairocontext.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   A <a href="class.cairocontext.html" class="classname">CairoContext</a>
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-cairocontext.construct-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2797">
    <p><strong>Example #1 <span class="methodname"><strong>CairoContext::__construct()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;The&nbsp;surface&nbsp;to&nbsp;work&nbsp;on<br /></span><span style="color: #0000BB">$surface&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">CairoImageSurface</span><span style="color: #007700">(</span><span style="color: #0000BB">CairoFormat</span><span style="color: #007700">::</span><span style="color: #0000BB">ARGB32</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Create&nbsp;a&nbsp;new&nbsp;CairoContext&nbsp;for&nbsp;the&nbsp;CairoSurface<br /></span><span style="color: #0000BB">$context&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">CairoContext</span><span style="color: #007700">(</span><span style="color: #0000BB">$surface</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-cairocontext.construct-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><strong>Cairo::Method()</strong></span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="cairocontext.closepath.html">CairoContext::closePath</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="cairocontext.copypage.html">CairoContext::copyPage</a></div>
 <div class="up"><a href="class.cairocontext.html">CairoContext</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
